package demo.hdz.mediacodecdecode;

import android.view.View;

import java.io.File;
import java.io.FileOutputStream;

public class Util {
    public static void saveData2File(byte[] data, String filePath) {
        try {
            File file = new File(filePath);
            FileOutputStream fos = new FileOutputStream(file, true);
            fos.write(data);
            fos.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static String visibility2String(int visibility) {
        switch (visibility) {
            case View.VISIBLE:
                return "VISIBLE";
            case View.INVISIBLE:
                return "INVISIBLE";
            case View.GONE:
                return "GONE";
            default:
                return "UNKNOWN: " +visibility;
        }
    }
}
